﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ABC.Business.Models
{
    public static class SmsModel
    {
        public static void Send(string phone, string msg)
        {
            using (var w = new System.Net.WebClient())
            {
                w.DownloadStringAsync(new Uri(string.Format(@"http://smsc.ru/sys/send.php?login={0}&psw={1}&phones={2}&mes={3}&charset=utf-8",
                    "azb24", "e3045cb0c3ad4dd57c47c6575a62120a", Regex.Replace(phone, "[^0-9+]", ""), msg)));
            }
        }

        public static void SendEmail(string email, string subject, string msg)
        {
            using (RosService.Client client = new RosService.Client())
            {
                client.Архив.ОтправитьПисьмо(email, subject, msg);
            }
        }
    }
}
